#include <vector>

using namespace std;

class Solution {
public:
    vector<vector<int>> findContinuousSequence(int target) {
        vector<vector<int>> ans;
        int i = 1;
        int sum = 1;
        for (int j = 1, stop = target / 2; j <= stop; ) {
            while (sum < target && j <= stop) {
                j++;
                sum += j;
            }
            if (sum == target) {
                vector<int> tmp;
                for (int k = i; k <= j; k++) {
                    tmp.push_back(k);
                }
                ans.push_back(tmp);
                sum -= i;
                i++;
            }
            while (sum > target && i < j) {
                sum -= i;
                i++;
            }
            if (sum == target) {
                vector<int> tmp;
                for (int k = i; k <= j; k++) {
                    tmp.push_back(k);
                }
                ans.push_back(tmp);
                sum -= i;
                i++;
            }
        }
        return ans;
    }
};